package com.example.demo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private Button videoView_btn;
    private Button surfaceView_btn;
    private Button surfaceView_mediaController_btn;
    private Button webViewWay1;
    private Button webViewWay2;
    private Button webViewWay3;
    private Button webView_js;
    private Button webView_js_loadURl;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        videoView_btn = findViewById(R.id.videoView_btn);
        surfaceView_btn = findViewById(R.id.surfaceView_btn);
        surfaceView_mediaController_btn = findViewById(R.id.surfaceView_mediaController_btn);

        videoView_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,FirstActivity.class);
                startActivity(intent);
            }
        });
        surfaceView_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,SecondActivity.class);
                startActivity(intent);
            }
        });
       surfaceView_mediaController_btn.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               Intent intent = new Intent(MainActivity.this,ThridActivity.class);
               startActivity(intent);
           }
       });
       webViewWay1 = findViewById(R.id.webView_way1);
        webViewWay2 = findViewById(R.id.webView_way2);
        webViewWay3 = findViewById(R.id.webView_way3);
        webViewWay1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,FourthActivity.class);
                startActivity(intent);
            }
        });
        webViewWay2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,FifthActivity.class);
                startActivity(intent);
            }
        });
        webViewWay3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,SixthActivity.class);
                startActivity(intent);
            }
        });
        webView_js = findViewById(R.id.webView_js);
        webView_js.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,WebViewWithJSActivity.class);
                startActivity(intent);
            }
        });
        webView_js_loadURl = findViewById(R.id.webView_js_loadURl);
        webView_js_loadURl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this, WvJsLoadURLActivity.class);
                startActivity(intent);
            }
        });
    }
}
